package com.rxjava;

import rx.Observable;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

/**
 * Created by kkmike999 on 16/5/12.
 */
public class unsubscribeOnTest {
	public static void main(String[] args) throws InterruptedException {
		Observable.just("test")
		          .subscribeOn(Schedulers.immediate())
		          .unsubscribeOn(Schedulers.immediate())
		          .doOnNext(new Action1<String>() {
			          @Override
			          public void call(String s) {
				          System.out.println("doOnNext");
			          }
		          })
		          .observeOn(Schedulers.immediate())
		          .subscribe(new Action1<String>() {
			          @Override
			          public void call(String s) {
				          System.out.println("subscribe");
			          }
		          });

		Thread.sleep(100);
	}
}
